home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-04 / ov_all.zip / TI630.ASC < prev    next >
Text File  |  1991-09-11  |  7KB  |  199 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.   PRODUCT  :  ObjectVision                           NUMBER  :  630
  9.   VERSION  :  1.0
  10.        OS  :  WIN
  11.      DATE  :  September 11, 1991                       PAGE  :  1/3
  12.  
  13.     TITLE  :  Creating an Incremental Number Field in ObjectVision
  14.  
  15.  
  16.  
  17.  
  18.   Description - The following instructions describe how to set up
  19.   an ObjectVision form that creates a unique and ordered record
  20.   number when a new record is created.
  21.  
  22.   How it works - Two fields are created in ObjectVision, "Number"
  23.   and "New Number".  "Number" corresponds to a keyed field in a
  24.   Paradox file.  "New Number" is defined as "Number" plus one.  A
  25.   third field, "Text", is inserted to demonstrate a data field. Two
  26.   links are set up.  One, called "Number Link", is simply a
  27.   direct read and write link to the corresponding fields "Number"
  28.   and "Text" in the Paradox table.  The other, called "New Number
  29.   Link", has a read link from "Number" in ObjectVision to "Number"
  30.   in the Paradox table.  The write link, however, is from the field
  31.   "New Number" in ObjectVision, which has the value of the "Number"
  32.   field in ObjectVision plus one.  The "Text" field in ObjectVision
  33.   has a read link from the "Text" field in Paradox.  The write link
  34.   is from the field "Blank" in ObjectVision.  This ensures a blank
  35.   field is inserted into the newly created field.
  36.  
  37.   A button called "New" is created.  It uses three functions:
  38.   @BOTTOM("New Number Link"), @INSERT("New Number Link") and
  39.   another @BOTTOM("New Number Link").  What this button does when
  40.   pressed follows: First it places the "New Number Link" link at
  41.   the bottom of the table.  The "Number" field in ObjectVision now
  42.   has the value of the last field in the table.  It appends a
  43.   record, writing the "New Number" field instead of the "Number"
  44.   field.  "New Number" has the value of the "Number" field plus
  45.   one.  This effectively inserts a unique and ordered number for
  46.   each new record at the bottom of the table.  The second @BOTTOM
  47.   function simply places the link at the bottom of the table.
  48.  
  49.   The "New Number Link" link should not be used for anything other
  50.   than executing the "New" button function.  Key violations and
  51.   other errors can occur if this link is used for anything else.
  52.   The second link, "Number Link", is used only for demonstration.
  53.   This shows how a different link can safely be used to view and
  54.   update the data without these problems.
  55.  
  56.   Instructions:
  57.  
  58.   A.) Create the form:
  59.     1.)   Start with a blank form.
  60.     2.)   Create two fields named "Number" and "Text".
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.   PRODUCT  :  ObjectVision                           NUMBER  :  630
  75.   VERSION  :  1.0
  76.        OS  :  WIN
  77.      DATE  :  September 11, 1991                       PAGE  :  2/3
  78.  
  79.     TITLE  :  Creating an Incremental Number Field in ObjectVision
  80.  
  81.  
  82.  
  83.  
  84.     3.)   Using Properties|Field Type, make the "Number" field a
  85.           Fixed field with zero decimal places.  Leave the "Text"
  86.           field as general.
  87.  
  88.   B.) Create the New Number Link:
  89.     1.)   Using the Tools|Links command, create a Paradox link.
  90.           The "Link Name" should be "New Number Link".  The
  91.           "Paradox Table Name" should be "NewNum" (be sure to start
  92.           with a new table).  Now select the "OK" option.  It will
  93.           create the new table at this point.  Answer "OK" when it
  94.           prompts "Unable to open Paradox table.  Create a new
  95.           table named NewNum?".  Be sure to answer "NO" when it
  96.           asks to "Automatically add appropriate buttons for new
  97.           link named New Number Link".
  98.     2.)   You will now be placed at the original link tool menu.
  99.           Select "Modify" to modify "New Number link".  Use the
  100.           Connect button to create a read link from the "Number"
  101.           field in ObjectVision to the "Number" field in the
  102.           Paradox table.  For the write link, select <Add New
  103.           Field> and create a field called "New Number".
  104.     3.)   Use the Connect button to create a read link from the
  105.           "Text" field in ObjectVision to the "Text" field in the
  106.           Paradox table.  For the write link, select <Add New
  107.           Field> and create a field called "Blank".  Select "OK"
  108.           twice to exit the link tool.
  109.  
  110.   C.) Format the "New Number" field:
  111.     1.)   Select Tools|Tree, Tree|Select and select the "New
  112.           Number" field.
  113.     2.)   Using Objects|Conclusion, create a conclusion that says
  114.           "+Number+1" (don't include the quotes). Now exit the Tree
  115.           tool.
  116.  
  117.   D.) Create a general purpose link:
  118.     1.)   Using Tools|Links, create another Paradox link called
  119.           "Number Link".  Use the same table created before,
  120.           "NewNum".  Select "OK" to establish the link.  When it
  121.           says "Unable to open link until all index fields are
  122.           connected to read links", select "OK".
  123.     2.)   Use the Connect button to create a read/write link from
  124.           the "Number" field in ObjectVision to the "Number" field
  125.           in the Paradox table.
  126.     3.)   The ObjectVision "Text" field should have a read/write
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139.  
  140.   PRODUCT  :  ObjectVision                           NUMBER  :  630
  141.   VERSION  :  1.0
  142.        OS  :  WIN
  143.      DATE  :  September 11, 1991                       PAGE  :  3/3
  144.  
  145.     TITLE  :  Creating an Incremental Number Field in ObjectVision
  146.  
  147.  
  148.  
  149.  
  150.           link to the "Text" field in the Paradox table.
  151.     4.)   Exit the link tool.  This time answer "YES" when it asks
  152.           to "Automatically add appropriate buttons for new link
  153.           named Number Link".
  154.  
  155.   E.) Create the Link button:
  156.     1.)   Create a button called "New".  Using the Tools|Tree tool,
  157.           type the following conclusion on the "New" button:
  158.           @BOTTOM("New Number Link") <CTRL><ENTER>
  159.           @INSERT("New Number Link") <CTRL><ENTER>
  160.           @BOTTOM("New Number Link")
  161.           (<CTRL><ENTER> creates a new line without exiting the
  162.           conclusion Dialog box.)
  163.     2.)   Now exit the Tree tool and the Form tool.
  164.  
  165.   F.) Initiate the table with a zero:
  166.     1.)   Place a zero in the "Number" field.  Select the "New"
  167.           button.  When it prompts "Operation on an empty table"
  168.           select "OK".
  169.  
  170.   When you want to create a new record, select the "New" button.
  171.   This creates a blank record with a new number.  When you want to
  172.   enter a value into a record, select the "Enter" button.  Values
  173.   entered into these new fields will be shaded.  This is because
  174.   these fields will be considered overridden by ObjectVision.  For
  175.   more information about overridden values, see "Overriding values"
  176.   of Chapter one, "ObjectVision: An Overview", in the Reference
  177.   Guide.
  178.  
  179.   This form is now ready to go.
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.